package com.kly.user.db.dao.impl;
import cn.hutool.core.date.DateUtil;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.kly.user.db.dao.TRuleHistoryLogDao;
import com.kly.user.db.entity.TRuleHistoryLogEntity;
import org.springframework.stereotype.Repository;

import java.util.Map;
import java.util.Objects;

/**
* User: linqu
* Date: 2023-07-04
* Time: 11:55:32.986
*/

@Repository
public class TRuleHistoryLogDaoImpl extends AbstractBaseMapper<TRuleHistoryLogEntity> implements TRuleHistoryLogDao {

    @Override
    public int removeLogs(Integer days) {
        Map<String, Object> params = Maps.newHashMap();
        params.put("gmtCreate", DateUtil.offsetDay(DateUtil.date(), days));
        return this.getSqlSession().delete(this.getStatement("removeLogs"), params);
    }
}